import Vue from 'vue'
import Router from 'vue-router'
import personCenter from '@/components/personCenterFrame.vue'
import myInfo from '../widget/personCenter/myInfo.vue'
import myPartner from '../widget/personCenter/myPartner.vue'
import myPhoto from '../widget/personCenter/myPhoto.vue'
import myPhotoDet from '../widget/personCenter/myPhotoDet.vue'
import myActivity from '../widget/personCenter/myActivity.vue'
import accountIden from '../widget/personCenter/accountIden.vue'
import myMood from '../widget/personCenter/myMood.vue'
import myFriend from '../widget/personCenter/myFriend.vue'
import myEmail from '../widget/personCenter/myEmail.vue'
import sendEmail from '../widget/personCenter/sendEmail.vue'
import checkEmail from '../widget/personCenter/checkEmail.vue'
import exchange from '../widget/personCenter/exchange.vue'
import manage from '../widget/personCenter/manage.vue'
import recommend from '../widget/personCenter/recommend.vue'
import loveColumn from '../widget/personCenter/loveColumn.vue'
import newsFrame from '../components/newsFrame.vue'
import articlesList from '../widget/articlesList.vue'
import article from '../widget/article.vue'

import vip from '../components/vip.vue'
import home from '../components/home/home.vue'
import otherPage from '../components/otherPage/otherPage.vue'
import Index from '@/components/Login/Index'
import Login from '@/components/Login/Login'
import Register from '@/components/Login/Register'
import RegisterDel from '@/components/Login/RegisterDel'
import Verify from '@/components/Login/Verify'
import Activity from '@/components/Activity/index'
import ActivityDel from '@/components/Activity/activityDel'
import ActivitySign from '@/components/Activity/activitySign'
import EmailProfList from '@/components/Email/index'
import ConsultProf from '@/components/Email/consultProf'

import base from '@/components/base'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/base',
      name: 'base',
      component: base,
      children: [
        {
          path: 'home',
          name: 'home',
          component: home
        },
        {
          path: 'personCenter',
          name: 'personCenter',
          component: personCenter,
          children:[
            {
              path: 'myInfo',
              name: 'myInfo',
              component: myInfo,
            },
            {
              path: 'myEmail',
              name: 'myEmail',
              component: myEmail,
            },
            {
              path: 'myEmail/send',
              name: 'myEmail/send',
              component: sendEmail,
            },
            {
              path: 'myEmail/check',
              name: 'myEmail/check',
              component: checkEmail,
            },
            {
              path: 'exchange',
              name: 'exchange',
              component: exchange,
            },
            {
              path: 'manage',
              name: 'manage',
              component: manage,
            },
            {
              path: 'recommend',
              name: 'recommend',
              component: recommend,
            },
            {
              path: 'loveColumn',
              name: 'loveColumn',
              component: loveColumn,
            },
            {
              path: 'myPhoto',
              name: 'myPhoto',
              component: myPhoto,
            },
            {
              path: 'myMood',
              name: 'myMood',
              component: myMood,
            },
            {
              path: 'myFriend',
              name: 'myFriend',
              component: myFriend,
            },
            {
              path: 'myPartner',
              name: 'myPartner',
              component: myPartner,
            },
            {
              path: 'myEmail',
              name: 'myEmail',
              component: myEmail,
            },
            {
              path: 'myPhotoDet',
              name: 'myPhotoDet',
              component: myPhotoDet,
            },
            {
              path: 'myMood',
              name: 'myMood',
              component: myMood,
            },
            {
              path: 'myActivity',
              name: 'myActivity',
              component: myActivity,
            },
            {
              path: 'accountIden',
              name: 'accountIden',
              component: accountIden,
            },
          ]
        },
        {
          path: 'news',
          name: 'newsFrame',
          component: newsFrame,
          children: [
            {
              path:':type',
              name:articlesList,
              component:articlesList,
            },
            {
              path:':type/article',
              name:article,
              component:article,
            },
          ]
        },
        {
          path: 'otherPage',
          name: 'otherPage',
          component: otherPage
        },
        {
          path: 'vip',
          name: 'vip',
          component:vip,
        },
        {
          path: 'activity',
          name: 'activity',
          component: Activity
        },
        {
          path: 'activity_del',
          name: 'activityDel',
          component: ActivityDel
        },
        {
          path: 'activity_sign',
          name: 'activitySign',
          component: ActivitySign
        },
        {
          path: 'email_list',
          name: 'emailProfList',
          component: EmailProfList
        },
        {
          path: 'consult_prof',
          name: 'consultProf',
          component: ConsultProf
        },
      ]
    },
    {
      path: '/loginPage',
      component: Index,
      redirect:'/loginPage/login',
      children: [
         {
           	path: 'login',
           	name: 'login',
           	component: Login
         },
         {
            path: 'register',
            name: 'register',
            component: Register
         },{
            path: 'register_del',
            name: 'registerDel',
            component: RegisterDel
         },{
            path: 'verify',
            name: 'verify',
            component: Verify
         }
      ]
    },
    {
      path:'*',
      redirect:'/loginPage'
    }
  ]
})
